<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>

<html>

<head>
   	<title>Upload File list</title>
   	<link href="../css/ept_style.css" rel="stylesheet" type="text/css">
</head>
	
<body>
<h2>Upload file list</h2>
<s:actionerror />
<s:form namespace="/esf/upload" method="post" enctype="multipart/form-data">
    <s:file name="fileAllegato" label="File Allegato" />
    <s:hidden name="backAction" />
    <s:hidden name="backNamespace"/>
    <s:hidden name="nextAction"/>
    <s:hidden name="nextNamespace"/>
    <s:submit value="Aggiungi" action="add" align="center"/>
    <c:forEach items="${allegati}" var="a" varStatus="status" >
    	<s:url var="ref" action="remove" >
    		<s:param name="id">${status.count -1}</s:param>
    	</s:url>
    	<p><c:out value="${a.filename}"/><span><s:a href="%{ref}"> <img style="width:20px" src="<s:url value='/img/delete.png'/>" /></s:a></span></p>
    </c:forEach>
    <div>
		<s:submit value="Indietro"  action="back"/>
		<s:submit value="Avanti"  action="next" />
	</div>
</s:form>
</body>
</html>